from fastapi import Depends, FastAPI
# import uvicorn
# from .dependencies import get_query_token, get_token_header
from .internal import admin
from .routers import RegisterRouterList


# 实例化
# app = FastAPI(dependencies=[Depends(get_query_token)])
app = FastAPI(redoc_url=None)

# 加载routers包里定义的路由 
for item in RegisterRouterList:
    app.include_router(item.router)

app.include_router(
    admin.router,
    prefix="/admin",
    tags=["admin"],
    # dependencies=[Depends(get_token_header)],
    responses={418: {"description": "I'm a teapot"}},
)

@app.get("/")
async def root():
    return {"message": "Hello Bigger Applications!"}


""" if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=8000) """